package uk.co.richardwkirk.parkrun.android;

public class ActiveSelections {

	public static final long NO_SELECTED_ATHLETE_ID = -1;
	
	// This class is a SINGLETON
	private static ActiveSelections instance;
	
	public static synchronized ActiveSelections getSingleton() {
		if (instance == null) {
			instance = new ActiveSelections();
		}
		return instance;
	}
	
	// And now for the interesting part...
	private long athleteId = NO_SELECTED_ATHLETE_ID;
	
	public void setAthleteId(long athleteId) {
		this.athleteId = athleteId;
	}
	
	public long getAthleteId() {
		return athleteId;
	}
	
	public boolean isAthleteSelected() {
		return athleteId != NO_SELECTED_ATHLETE_ID;
	}
	
}
